#ifndef SHAREMEMROY_H_
#define SHAREMEMROY_H_
#include <iostream>
using namespace std;
class ShareMemory {
  static int sm_counter;
  static int sm_size;
  static int * sm_data;
  bool checkIndex(int index) const;
 public:
  ShareMemory(int sz);
  ShareMemory(const ShareMemory &);
  ShareMemory& operator =(const ShareMemory &);
  int getSize() const { return sm_size; }
  int read(int index) const; // read
  void write(int index, int value);
  virtual ~ShareMemory();
};

#endif /*SHAREMEMROY_H_*/
